package com.zhangbo.study.designpatternlearning.factory;

/**
 * 工厂抽象对象
 */
public abstract class PizzaStore {

    public Pizza orderPizza(PizzaEnum pizzaEnum) {
        Pizza pizza = createPizza(pizzaEnum);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }

    /**
     * 用于构建不同实例对象
     * @param pizzaEnum
     * @return
     */
    public abstract Pizza createPizza(PizzaEnum pizzaEnum);

}
